<template>
    <vechart :id="id"  :option="chartoption"></vechart>
</template>

<script>
    import vechart from './vechart.vue';
    import {exam} from '../../../../../api/index.js';
    export default {
        components: {vechart},
        props: ["id", "chartData"],
        data() {
            return {
                chartoption: {
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'value',
                        boundaryGap: [0, 0.01]
                    },
                    yAxis: {
                        type: 'category',
                        data:this.chartData.yAxis
                    },
                    series: [
                        {
                            name: this.chartData.name,
                            type: 'bar',
                            data: this.chartData.data
                        }
                    ]
                }
            }
        },
        mounted() {

        }
    };
</script>
